import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from "@nestjs/common";
import { StudentInoutMessageService } from "./student-inout-message.service";
import { ApiBearerAuth, ApiOperation, ApiTags } from "@nestjs/swagger";
import { NotToken } from "@/decorators/not-token.decorator";
import { StudentInoutMessage } from "./entities/student-inout-message.entity";
@Controller("hik/student-inout-message")
@ApiTags("海康人脸进出记录管理")
@ApiBearerAuth()

export class StudentInoutMessageController {
  constructor(private readonly studentInoutMessageService: StudentInoutMessageService) {}

  @Post()
  @ApiOperation({ summary: "创建海康人脸进出记录" })
  create(@Body() createDto: Partial<StudentInoutMessage>) {
    return this.studentInoutMessageService.create(createDto);
  }

  @Get()
  @ApiOperation({ summary: "查询海康人脸进出记录列表（分页）" })
  findAll(@Query() query: { page?: number; size?: number; [key: string]: any }) {
    return this.studentInoutMessageService.findAll(query);
  }

  @Get(":id")
  @ApiOperation({ summary: "查询海康人脸进出记录详情" })
  findOne(@Param("id") id: string) {
    return this.studentInoutMessageService.findOne(+id);
  }

  @Patch(":id")
  @ApiOperation({ summary: "更新海康人脸进出记录" })
  update(@Param("id") id: string, @Body() updateDto: Partial<StudentInoutMessage>) {
    return this.studentInoutMessageService.update(+id, updateDto);
  }

  @Delete("batch")
  @ApiOperation({ summary: "批量删除海康人脸进出记录" })
  removeBatch(@Body() { ids }: { ids: number[] }) {
    return this.studentInoutMessageService.removeBatch(ids);
  }

  @Delete(":id")
  @ApiOperation({ summary: "删除海康人脸进出记录" })
  remove(@Param("id") id: string) {
    return this.studentInoutMessageService.remove(+id);
  }
}